import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_event_plan_entity.dart';

EmergencyEventPlanEntity $EmergencyEventPlanEntityFromJson(Map<String, dynamic> json) {
  final EmergencyEventPlanEntity emergencyEventPlanEntity = EmergencyEventPlanEntity();
  final String? accidentAtTime = jsonConvert.convert<String>(json['accidentAtTime']);
  if (accidentAtTime != null) {
    emergencyEventPlanEntity.accidentAtTime = accidentAtTime;
  }
  final String? accidentGeneral = jsonConvert.convert<String>(json['accidentGeneral']);
  if (accidentGeneral != null) {
    emergencyEventPlanEntity.accidentGeneral = accidentGeneral;
  }
  final String? accidentName = jsonConvert.convert<String>(json['accidentName']);
  if (accidentName != null) {
    emergencyEventPlanEntity.accidentName = accidentName;
  }
  final String? accidentNameId = jsonConvert.convert<String>(json['accidentNameId']);
  if (accidentNameId != null) {
    emergencyEventPlanEntity.accidentNameId = accidentNameId;
  }
  final String? accidentReceptionTime = jsonConvert.convert<String>(json['accidentReceptionTime']);
  if (accidentReceptionTime != null) {
    emergencyEventPlanEntity.accidentReceptionTime = accidentReceptionTime;
  }
  final List<String>? accidentScenePhotos = (json['accidentScenePhotos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (accidentScenePhotos != null) {
    emergencyEventPlanEntity.accidentScenePhotos = accidentScenePhotos;
  }
  final String? anotherAttention = jsonConvert.convert<String>(json['anotherAttention']);
  if (anotherAttention != null) {
    emergencyEventPlanEntity.anotherAttention = anotherAttention;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyEventPlanEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyEventPlanEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyEventPlanEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyEventPlanEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyEventPlanEntity.deleted = deleted;
  }
  final List<dynamic>? emergencyExpertId = (json['emergencyExpertId'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (emergencyExpertId != null) {
    emergencyEventPlanEntity.emergencyExpertId = emergencyExpertId;
  }
  final String? handlePlanId = jsonConvert.convert<String>(json['handlePlanId']);
  if (handlePlanId != null) {
    emergencyEventPlanEntity.handlePlanId = handlePlanId;
  }
  final String? handlePlanName = jsonConvert.convert<String>(json['handlePlanName']);
  if (handlePlanName != null) {
    emergencyEventPlanEntity.handlePlanName = handlePlanName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyEventPlanEntity.id = id;
  }
  final String? instanceProtectAdvice = jsonConvert.convert<String>(json['instanceProtectAdvice']);
  if (instanceProtectAdvice != null) {
    emergencyEventPlanEntity.instanceProtectAdvice = instanceProtectAdvice;
  }
  final String? liveHandelAdvice = jsonConvert.convert<String>(json['liveHandelAdvice']);
  if (liveHandelAdvice != null) {
    emergencyEventPlanEntity.liveHandelAdvice = liveHandelAdvice;
  }
  final String? otherFile = jsonConvert.convert<String>(json['otherFile']);
  if (otherFile != null) {
    emergencyEventPlanEntity.otherFile = otherFile;
  }
  final List<dynamic>? refugeId = (json['refugeId'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (refugeId != null) {
    emergencyEventPlanEntity.refugeId = refugeId;
  }
  final List<dynamic>? rescueGoodsId = (json['rescueGoodsId'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (rescueGoodsId != null) {
    emergencyEventPlanEntity.rescueGoodsId = rescueGoodsId;
  }
  final List<dynamic>? rescueTeamId = (json['rescueTeamId'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (rescueTeamId != null) {
    emergencyEventPlanEntity.rescueTeamId = rescueTeamId;
  }
  final String? rescueTeam = jsonConvert.convert<String>(json['rescueTeam']);
  if (rescueTeam != null) {
    emergencyEventPlanEntity.rescueTeam = rescueTeam;
  }
  final String? rescueGoods = jsonConvert.convert<String>(json['rescueGoods']);
  if (rescueGoods != null) {
    emergencyEventPlanEntity.rescueGoods = rescueGoods;
  }
  final String? emergencyExpert = jsonConvert.convert<String>(json['emergencyExpert']);
  if (emergencyExpert != null) {
    emergencyEventPlanEntity.emergencyExpert = emergencyExpert;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyEventPlanEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyEventPlanEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyEventPlanEntity.updateDate = updateDate;
  }
  final String? commanderInChief = jsonConvert.convert<String>(json['commanderInChief']);
  if (commanderInChief != null) {
    emergencyEventPlanEntity.commanderInChief = commanderInChief;
  }
  final String? deputyCommander = jsonConvert.convert<String>(json['deputyCommander']);
  if (deputyCommander != null) {
    emergencyEventPlanEntity.deputyCommander = deputyCommander;
  }
  final String? deputyOnSiteCommander = jsonConvert.convert<String>(json['deputyOnSiteCommander']);
  if (deputyOnSiteCommander != null) {
    emergencyEventPlanEntity.deputyOnSiteCommander = deputyOnSiteCommander;
  }
  final String? onSiteCommander = jsonConvert.convert<String>(json['onSiteCommander']);
  if (onSiteCommander != null) {
    emergencyEventPlanEntity.onSiteCommander = onSiteCommander;
  }
  final String? onSiteTeam = jsonConvert.convert<String>(json['onSiteTeam']);
  if (onSiteTeam != null) {
    emergencyEventPlanEntity.onSiteTeam = onSiteTeam;
  }
  final String? accidentUpdate = jsonConvert.convert<String>(json['accidentUpdate']);
  if (accidentUpdate != null) {
    emergencyEventPlanEntity.accidentUpdate = accidentUpdate;
  }
  final String? handleStateLabel = jsonConvert.convert<String>(json['handleStateLabel']);
  if (handleStateLabel != null) {
    emergencyEventPlanEntity.handleStateLabel = handleStateLabel;
  }
  final String? handleState = jsonConvert.convert<String>(json['handleState']);
  if (handleState != null) {
    emergencyEventPlanEntity.handleState = handleState;
  }
  return emergencyEventPlanEntity;
}

Map<String, dynamic> $EmergencyEventPlanEntityToJson(EmergencyEventPlanEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['accidentAtTime'] = entity.accidentAtTime;
  data['accidentGeneral'] = entity.accidentGeneral;
  data['accidentName'] = entity.accidentName;
  data['accidentNameId'] = entity.accidentNameId;
  data['accidentReceptionTime'] = entity.accidentReceptionTime;
  data['accidentScenePhotos'] = entity.accidentScenePhotos;
  data['anotherAttention'] = entity.anotherAttention;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['emergencyExpertId'] = entity.emergencyExpertId;
  data['handlePlanId'] = entity.handlePlanId;
  data['handlePlanName'] = entity.handlePlanName;
  data['id'] = entity.id;
  data['instanceProtectAdvice'] = entity.instanceProtectAdvice;
  data['liveHandelAdvice'] = entity.liveHandelAdvice;
  data['otherFile'] = entity.otherFile;
  data['refugeId'] = entity.refugeId;
  data['rescueGoodsId'] = entity.rescueGoodsId;
  data['rescueTeamId'] = entity.rescueTeamId;
  data['rescueTeam'] = entity.rescueTeam;
  data['rescueGoods'] = entity.rescueGoods;
  data['emergencyExpert'] = entity.emergencyExpert;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['commanderInChief'] = entity.commanderInChief;
  data['deputyCommander'] = entity.deputyCommander;
  data['deputyOnSiteCommander'] = entity.deputyOnSiteCommander;
  data['onSiteCommander'] = entity.onSiteCommander;
  data['onSiteTeam'] = entity.onSiteTeam;
  data['accidentUpdate'] = entity.accidentUpdate;
  data['handleStateLabel'] = entity.handleStateLabel;
  data['handleState'] = entity.handleState;
  return data;
}

extension EmergencyEventPlanEntityExtension on EmergencyEventPlanEntity {
  EmergencyEventPlanEntity copyWith({
    String? accidentAtTime,
    String? accidentGeneral,
    String? accidentName,
    String? accidentNameId,
    String? accidentReceptionTime,
    List<String>? accidentScenePhotos,
    String? anotherAttention,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    List<dynamic>? emergencyExpertId,
    String? handlePlanId,
    String? handlePlanName,
    String? id,
    String? instanceProtectAdvice,
    String? liveHandelAdvice,
    String? otherFile,
    List<dynamic>? refugeId,
    List<dynamic>? rescueGoodsId,
    List<dynamic>? rescueTeamId,
    String? rescueTeam,
    String? rescueGoods,
    String? emergencyExpert,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? commanderInChief,
    String? deputyCommander,
    String? deputyOnSiteCommander,
    String? onSiteCommander,
    String? onSiteTeam,
    String? accidentUpdate,
    String? handleStateLabel,
    String? handleState,
  }) {
    return EmergencyEventPlanEntity()
      ..accidentAtTime = accidentAtTime ?? this.accidentAtTime
      ..accidentGeneral = accidentGeneral ?? this.accidentGeneral
      ..accidentName = accidentName ?? this.accidentName
      ..accidentNameId = accidentNameId ?? this.accidentNameId
      ..accidentReceptionTime = accidentReceptionTime ?? this.accidentReceptionTime
      ..accidentScenePhotos = accidentScenePhotos ?? this.accidentScenePhotos
      ..anotherAttention = anotherAttention ?? this.anotherAttention
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..emergencyExpertId = emergencyExpertId ?? this.emergencyExpertId
      ..handlePlanId = handlePlanId ?? this.handlePlanId
      ..handlePlanName = handlePlanName ?? this.handlePlanName
      ..id = id ?? this.id
      ..instanceProtectAdvice = instanceProtectAdvice ?? this.instanceProtectAdvice
      ..liveHandelAdvice = liveHandelAdvice ?? this.liveHandelAdvice
      ..otherFile = otherFile ?? this.otherFile
      ..refugeId = refugeId ?? this.refugeId
      ..rescueGoodsId = rescueGoodsId ?? this.rescueGoodsId
      ..rescueTeamId = rescueTeamId ?? this.rescueTeamId
      ..rescueTeam = rescueTeam ?? this.rescueTeam
      ..rescueGoods = rescueGoods ?? this.rescueGoods
      ..emergencyExpert = emergencyExpert ?? this.emergencyExpert
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..commanderInChief = commanderInChief ?? this.commanderInChief
      ..deputyCommander = deputyCommander ?? this.deputyCommander
      ..deputyOnSiteCommander = deputyOnSiteCommander ?? this.deputyOnSiteCommander
      ..onSiteCommander = onSiteCommander ?? this.onSiteCommander
      ..onSiteTeam = onSiteTeam ?? this.onSiteTeam
      ..accidentUpdate = accidentUpdate ?? this.accidentUpdate
      ..handleStateLabel = handleStateLabel ?? this.handleStateLabel
      ..handleState = handleState ?? this.handleState;
  }
}
